// 用户相关
import request from '@/utils/request'
// 登录
export const checkLogin = data => {
        return request({
            method: 'post',
            url: '/users/checkLogin',
            data
        })
    }
    // 添加账号
export const addAccount = data => {
        return request({
            method: 'post',
            url: '/users/add',
            data
        })
    }
    // 获取账号列表
export const getAccount = params => {
        return request({
            method: 'get',
            url: '/users/list',
            params
        })
    }
    // 删除账号
export const delAccount = params => {
        return request({
            method: 'get',
            url: '/users/del',
            params
        })
    }
    // 修改账号
export const editAccount = data => {
        return request({
            method: 'post',
            url: '/users/edit',
            data
        })
    }
    // 批量删除账号
export const batchDelAccount = params => {
        return request({
            method: 'get',
            url: '/users/batchdel',
            params
        })
    }
    // 检查原密码是否正确
export const validateOldPwd = data => {
        return request({
            method: 'get',
            url: '/users/checkoldpwd',
            data
        })
    }
    // 修改密码
export const updatePwd = data => {
        return request({
            method: 'post',
            url: '/users/editpwd',
            data
        })
    }
    // 获取个人信息
export const getUserInfo = () => {
    return request({
        method: 'get',
        url: '/users/info'
    })
}

// 修改头像
export const updateAvatar = params => {
    return request({
        method: 'get',
        url: '/users/avataredit',
        params
    })
}